package com.huatai.saas.mapper;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.huatai.saas.entity.WorkingOrderEntity;
import com.huatai.saas.vo.WorkingOrderListVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

/**
 * 工单的数据持久层
 */
@Repository
@Mapper
public interface WorkingOrderMapper extends BaseMapper<WorkingOrderEntity> {
	/**
	 *查询工单列表信息
	 * @param page 分页信息
	 * @param wrapper 过滤条件
	 * @return 工单列表信息
	 */
	@Select("SELECT id,order_number,user_name,user_id,parent_id,child_id,child_name,description,phone,order_status,result,account,process_name,sort" +
		    " FROM working_order ${ew.customSqlSegment} ORDER BY create_time DESC")
	IPage<WorkingOrderListVO> getOrderList(Page<WorkingOrderListVO> page, @Param(Constants.WRAPPER)LambdaQueryWrapper wrapper);

}
